<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
	
<!DOCTYPE html>
<html>
	<head>
		<title>学员管理</title>
		<meta name="decorator" content="default"/>
		<script type="text/javascript">     
			$(function(){ 
				var defHeight = 300,wh=$(window).height();
				var lh=$('.location').height(),fh=$('#floatHead').height(),sh=$('.det-list').height(),ph=$('.pagelist').height();
				defHeight = (wh-lh-fh-sh-ph-130);
				$('.flexgrid').flexigrid({striped:true,height:defHeight});
				
				$('.choose').click(function(){
					var data = {};
					data.row = $(this).attr('row-data');
					data.mode = '${mode}';
					if(top.frames["mainframe"]){
						var w = top.frames["mainframe"];
						if(w.chooseStudent){
							w.chooseStudent(data);
						}
					}
					
					if(top.chooseStudent){
						top.chooseStudent(data);
					}
				});
			});
			
			function page(n,s){
				$("#pageNo").val(n);
				$("#pageSize").val(s);
				$("#searchForm").submit();
	        	return false;
	        }
	        
	        function deleteAll(){
				var ids =[];//定义一个数组    
	            $('input[name="checkall"]:checked').each(function(){    
	                ids.push($.trim($(this).val()));
	            });
	            document.location.href='${ctx}/qd/student/delete?ids='+ids;
			}
		</script>
	</head>
	<body>
		<sys:message content="${message}"/>
		<!--搜索栏-->
		<form:form id="searchForm" modelAttribute="student" action="${ctx}/qd/course/choose" method="post">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
			<div class="det-list clearfix">
			    <div class="group btm">
					<div class="control">
			            <div class="title">学员姓名</div>
			            <form:input path="name" htmlEscape="false" cssClass="input normal"/>
			        </div>
			    </div>   
			    <div class="group searchbtn">
			        <div class="btn-list">
			            <input type="submit" name="btnDetailedSearch" value="查询" id="btnDetailedSearch" class="btn">
			            <input name="btnReturn" type="reset" value="重置" class="btn yellow">
			        </div>
			    </div>
			    <div style="clear:both;"></div>
			</div>
		</form:form>
		<!--/搜索栏-->
		
		<!--列表-->
		<div class="table-container">
			<table class="flexgrid">
				<thead>
					<tr>
						<th width="25">选择</th>
						<th width="100">学员编号</th>
						<th width="100">学员姓名</th>
						<th width="100">家长姓名</th>
						<th width="100">家长手机</th>
						<th width="100">学员出生日期</th>
						<th width="100">性别</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.list}" var="student">
					<tr>
						<td style="text-align:center;">
							<c:choose>
								<c:when test="${mode eq 'queue'}"><a  class="choose" href="${ctx }/qd/course/choose?studentid=${student.id} " row-data="${student.id}">排队</a></c:when>
								<c:otherwise><a class="choose" href="#" row-data="${student.id},${student.name},${student.member.name},${student.mobile}">约课</a></c:otherwise>
							</c:choose>
						</td>
						<td>${student.code}</td>
						<td>${student.name}</td>
						<td>${student.member.name}</td>
						<td>${student.mobile}</td>
						<td><fmt:formatDate value="${student.birthday}" pattern="yyyy-MM-dd" /></td>
						<td><c:choose><c:when test="${student.sex==1}">男</c:when><c:when test="${student.sex==0}">女</c:when><c:otherwise>未知</c:otherwise></c:choose></td>
					</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<!--/列表-->

		<!--内容底部-->
		<div class="line10"></div>
		<div class="pagelist">
			${page}
		</div>
		<!--/内容底部-->
	</body>
</html>
